package com.wocao.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 社区互动表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("zy_community_interaction")
public class ZyCommunityInteraction implements Serializable {

    /**
     * id
     */
    @TableId("interaction_id")
    private String interactionId;

    /**
     * 小区ID
     */
    private String communityId;

    /**
     * 创建人ID
     */
    private String createBy;

    /**
     * 更新者ID
     */
    private String updateBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    /**
     * 内容
     */
    private String content;

    /**
     * 图片
     */
    private String images;

    /**
     * 删除状态0默认1删除
     */
    private Integer delFlag;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人ID
     */
    private String userId;

    /**
     * 点赞总数
     */
    private Integer likeCount;

    /**
     * 业主信息
     */
    @TableField(exist = false)
    private ZyOwner zyOwner;

    /**
     * 评论信息
     */
    @TableField(exist = false)
    private ZyComment zyComment;


    /**
     * 一个文章下 会存在多个评论
     */
    @TableField(exist = false)
    private List<ZyComment> zyComments;


    public ZyCommunityInteraction(String interactionId){
        this.interactionId = interactionId;
    }

}
